import * as appConfig from '../../../../app-config.js'
var app = getApp()
Page({
   data: {
    tempFilePaths:[],
    morningFee:'',
    afternoonFee:'',
    agentId:''
  },

  onLoad: function () {
      app.getMemInfo().then(res=>{
        let data = {agentId:res.data.agentId}
        this.getFeeSetList(data)
        this.setData({
          agentId:res.data.agentId
        })
      })
      
  },
  //获取人工费列表
  getFeeSetList(agentId){
    console.log(agentId)
    wx.request({
      url:appConfig.apiBase+'wx_app/cost/labor/list',
      data:agentId,
      success(res){
        console.log(res)
      }
    })
  },
  bindKeyInputMorning(e){
    this.setData({
      morningFee:e.detail.value
    })
  },
  bindKeyInputAfternoon(e){
    this.setData({
      afternoonFee:e.detail.value
    })
  },
  //保存人工费设置
  setFeeSetList(){
    var data = {
      agentId:this.data.agentId,
      price1:this.data.morningFee,
      price2:this.data.afternoonFee
    }
    app.request('wx_app/cost/labor/setting',data,'GET').then(res=>{
      console.log(res)

    })
  }
})